#coding=utf-8
#!/usr/bin/python

import socket  
import time  
if __name__ == '__main__':  

    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)  
    
    
    sock.connect(('localhost', 8001))  
    time.sleep(3)  
    """
    返回欢迎
    """
    sock.send('1')  
    """
    关闭服务器
    """
    sock.send('23')  
    print sock.recv(1024)  
    sock.close()  